]> dgit.raspbian.org Git - gnome-shell.git/commit
history: Trim input and ignore if empty
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Mon, 8 Feb 2021 21:20:42 +0000 (22:20 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sat, 13 Feb 2021 08:58:20 +0000 (08:58 +0000)
commitd31f805817970fe42e3c0dae5e3faa6eca2ef88e
treef0eee8d5e5930251167d5e2e0a6cbdd5b3851e9c
parent30203f26943a31fdce8419006c0a2c209296b4fc
history: Trim input and ignore if empty

This ports the runDialog changes of [1] to the underlying history
component, where they can benefit looking glass as well: the history is
now responsible for trimming the input and deciding that it shouldn’t be
stored if empty. (Note that _setPrevItem and _setNextItem already
skipped updating the history if the entry was empty.)

Since both users, runDialog and lookingGlass, also need the trimmed
input for other reasons – runDialog to avoid issues when interpreting
the command as a file path (if it can’t be executed as a command),
lookingGlass to decide whether a command should be run at all – have
addItem return the trimmed input. (runDialog and lookingGlass are not
yet changed to take advantage of this – that will be done in separate
commits.)

[1]: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1442

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1653>
js/misc/history.js